package pgdgit01;

/**
 * Models adding publication items to a library
 * @robin UWC PGD SWD group, September 2013
 */
public class Publication implements LibraryItem {
    
    PublicationType publicationType;
    int publicationId;
    String publicationName;
    String publisher;
    String publicationDate;
    String publicationPlace;
    String checkoutDate;
    String returnDate;
    String authors;
    public static int increment = 1; //initialized a variable to auto increment 
                                     //the ID's in the constructor as requested by the group doing the main method

   /**
    * Constructs a Publication with given type, id and name
    * @param publicationType the type of publication items to be added to the library e.g. Book, DVD, eBook, etc
    * @param publicationId the publication id assigned to the item, Auto incremented by 1 for all item types
    * @param publicationName the name of the item
    * @param authors the author(s) of the item 
    */
 public Publication(PublicationType publicationType, String publicationName, String authors) {
        this.publicationType = publicationType;
        this.publicationId = increment;
        this.publicationName = publicationName;
        this.authors = authors;
        increment++;
    }
    /**
     * Constructs a Publication with the given field values
     * @param publicationType the type of publication items to be added to the library e.g. Book, DVD, eBook, etc
     * @param publicationId the publication id assigned to the item, Auto incremented by 1 for all item types
     * @param publicationName the name of the item
     * @param publisher the publisher of the item 
     * @param publicationDate the publication date of the item
     * @param publicationPlace the publication house, location of the item 
     * @param authors the author(s) of the item 
     */
    public Publication(PublicationType publicationType, String publicationName, String publisher, String publicationDate, String publicationPlace, String authors) {
        this.publicationType = publicationType;
        this.publicationId = increment;
        this.publicationName = publicationName;
        this.publisher = publisher;
        this.publicationDate = publicationDate;
        this.publicationPlace = publicationPlace;
        this.authors = authors;
        increment++;
    }
    /**
     * Constructs a Publication with given type and name 
     * @param publicationType the type of publication items to be added to the library e.g. Book, DVD, eBook, etc
     * @param publicationName the name of the item
     */
    public Publication(PublicationType publicationType, String publicationName) {
        this.publicationType = publicationType;
        this.publicationName = publicationName;
        increment++;
    }
    /**
     * Getter for the PublicationType of the Publication.
     * @returns the publicationType
     */
    public PublicationType getItemType() {
        return publicationType;
    }
    /**
     * Getter for the Publication identification number.
     * @returns the publicationId 
     */
    public int getItemId(){
        return publicationId;
    }
    /**
     * Getter for the name of the Publication.
     * @returns the publicationName 
     */

    public String getItemName() {
        return publicationName;
    }
    /**
     * Getter for the date on which the Publication was checked out of the library.
     * @returns the checkoutDate 
     */

    public String getCheckoutDate() {
        return checkoutDate;
    }
    /**
     * Getter for the full Publication details as a formatted string,
     * @returns the full details regarding the item 
     */
    public String getFullDetails(){
        String fullDetails = "";
        
        fullDetails = getItemType() +" - ID " + getItemId() +": "+ getItemName() 
                +"\n"+ getAuthors() +", "+ publicationDate +"\n"+ publisher+", "+ publicationPlace;
        
        return fullDetails;
    }
    /**
     *Getter for the date by which the Publication must be returned to the library.
     * @returns the returnDate 
     */
    
    public String getReturnDate() {
        return returnDate;
    }
    /**
     * Getter for the (list) of Publication authors.
     * @returns the details of the author 
     */
    public String getAuthors() {
        return authors;
    }
    /**
     * Setter for the PublicationType of the item
     * @param publicationType 
     */
     
    public void setPublicationType(PublicationType publicationType) {
        this.publicationType = publicationType;
    }
    /**
     * Setter for the integral identification number of the Publication.
     * @param publicationId 
     */
    public void setPublicationId(int publicationId) {
        this.publicationId = publicationId;
    }
    /**
     * Setter for the name of the Publication.
     * @param publicationName 
     */
    public void setPublicationName(String publicationName) {
        this.publicationName = publicationName;
    }
    /**
     * Setter for the name of the Publication publisher.
     * @param publisher 
     */
    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }
    /**
     * Setter for the date on which the Publication was published.
     * @param publicationDate 
     */
    public void setPublicationDate(String publicationDate) {
        this.publicationDate = publicationDate;
    }
    /**
     * Setter for the city/town &c.
     * @param publicationPlace 
     */
    public void setPublicationPlace(String publicationPlace) {
        this.publicationPlace = publicationPlace;
    }
    /**
     * Setter for the date on which the Publication was checked out of the library.
     * @param checkoutDate 
     */
    public void setCheckoutDate(String checkoutDate) {
        this.checkoutDate = checkoutDate;
    }
    /**
     * Setter for the date on which the Publication must be returned to the library.
     * @param returnDate 
     */
    public void setReturnDate(String returnDate) {
        this.returnDate = returnDate;
    }
    /**
     * Setter for the (list) of Publication authors.
     * @param authors 
     */
    public void setAuthors(String authors) {
        this.authors = authors;
        
    }
    
    
    
}